# 导入drf分页模块
from rest_framework.pagination import PageNumberPagination # 简单分页
from rest_framework.pagination import LimitOffsetPagination  # 偏移分页
from rest_framework.pagination import CursorPagination  # 指针分页


class MyPageNumberPagination(PageNumberPagination):
    page_size = 2
    page_query_param = 'page'
    page_size_query_param = 'size'
    max_page_size = 3


class MyLimittOffsetPagination(LimitOffsetPagination):
    default_limit = 2
    limit_query_param = 'limit'
    offset_query_param = 'offset'
    max_limit = 3


class MyCursorPagination(CursorPagination):
    cursor_query_param = 'cursor'
    ordering = 'loginid'
    page_size = 2
    max_page_size = 3
